package datastructure.segmenttree;

/**
 * @author: Oliver
 * @time: 2020/5/29/11:42
 */
public class Main {
    public static void main(String[] args) {
        Integer[] ints = {-2, 0, 3, -5, 2, -1};
        SegmentTree sgTree = new SegmentTree(ints, new Merger<Integer>() {
            @Override
            public Integer merge(Integer a, Integer b) {
                return a + b;
            }
        });

//        System.out.println(sgTree.toString());
        System.out.println(sgTree.query(2, 5));
    }
}
